package com.jf.cloud.service.sysmanager.config;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.jf.cloud.service.sysmanager.dao.IPubgBasePropsConfigService;

@Component
public class InitBaseData implements CommandLineRunner {

	/**
	 * 日志
	 */
	private static Log log = LogFactory.getLog(InitBaseData.class);
	
	@Autowired
	private IPubgBasePropsConfigService pubgBasePropsConfigService;
	
	@Override
	public void run(String... args) throws Exception {
		
		log.info("开始加载OA的定时器和基础配置信息...");
		this.loadBaseConfigProps();
		
		log.info("结束加载OA的定时器和基础配置信息...");
	}
	
	/**
	 * 初始化基础配置信息
	 * 
	 * @author 朱建文 创建时间：2018年4月3日 上午11:09:44
	 */
	public void loadBaseConfigProps() {
		try {
			this.pubgBasePropsConfigService.refreshConfigToContant();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
